{% macro pagination(pages, page = 1) %}
<div class="pagination">
    <a href="?page=1">首页</a>
    <a href="?page={{page-1}}">&lt;</a>
    {%for i in range(1, pages+1)%}
    {%if i == page%}
    <a href="?page={{i}}" class="current">{{i}}</a>
    {%else%}
    <a href="?page={{i}}">{{i}}</a>
    {%endif%}
    {%endfor%}
    <a href="?page={{page+1}}">&gt;</a>
    <a href="?page={{pages}}">尾页</a>
</div>
{% endmacro %}